- Random notes -
---

Conventions:
 Try to be C89 compliant
 Enclose translatable strings in _()
 Functions return 0 on success, 1 on failure
 Error messages are outputted to stderr
Acronyms:
 cid - channel ID
 vid - video ID
 pid - playlist ID

---

database fields -
channel:        id, 0, URL, name, thumbnail, subscriptions, description
video:          id, vid, title, duration, timestamp, description 

URL formats -
channel URL:    https://www.youtube.com/channel/$cid
channel RSS:    https://www.youtube.com/feeds/videos.xml?channel_id=$cid
playlist URL:   https://www.youtube.com/playlist?list=$pid
video URL:      https://www.youtube.com/watch?v=$vid
        OR      https://youtu.be/$vid    
thumbnail:      https://i.ytimg.com/vi/$vid/hqdefault.jpg
OPML file:      https://www.youtube.com/subscription_manager?action_takeout=1

---

 w3mimg protocol
  0  1  2 ....
 +--+--+--+--+ ...... +--+--+
 |op|; |args             |\n|
 +--+--+--+--+ .......+--+--+

 args is separeted by ';'
 op   args
  0;  params          draw image
  1;  params          redraw image
  2;  -none-          terminate drawing
  3;  -none-          sync drawing
  4;  -none-          nop, sync communication
                      response '\n'
  5;  path            get size of image,
                      response "<width> <height>\n"
  6;  params(6)       clear image

 params
      <n>;<x>;<y>;<w>;<h>;<sx>;<sy>;<sw>;<sh>;<path>
 params(6)
      <x>;<y>;<w>;<h>
